package com.specter.boot.auto;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.specter.sure.core.filter.SpecterSecurityFilter;

@Configuration
public class SpecterSureStarterConfiguration {

    // ========== 安全过滤器配置 ==========
    @Bean
    public FilterRegistrationBean<SpecterSecurityFilter> filter(SpecterSecurityFilter filter) {
        FilterRegistrationBean<SpecterSecurityFilter> registration = new FilterRegistrationBean<>();
        registration.setFilter(filter);
        registration.setOrder(1); // 设置过滤器顺序
        return registration;
    }
}
